﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FlowSequencer.Core.FlowElements
{
    public class Line : ICloneable
    {
        private Line line;

        public Line()
        {
            Name = "DefaultLineName";
            Tasks = new List<Task>();
        }

        private Line(Line line)
        {
            this.Name = line.Name;
            foreach (var task in line.Tasks)
            {
                var t = task.Clone() as Task;
                Tasks.Add(t);
            }
        }

        public int Cycles
        {
            get { return Tasks.Sum(x => x.Cycles); }
        }
        public string Name { get; set; }
        public List<Task> Tasks { get; set; }

        public object Clone()
        {
            return new Line(this);
        }
    }
}
